<template>
  <div class="outline-parent">
    <div class="flex-box border-hover-style">
      <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
      </t-image-viewer>
      <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
      </van-image-preview>
      <div class="Showroom-parent" v-if="props.info.digitalShowroom">
        <digitalShowroomInfo :url="props.info.digitalShowroom" :id="props.info.id" />
      </div>
      <img class="outline-parent-bg" :src="publicUrls + 'free/style6/Level3outlineStyle3Bg.webp'" alt="" />
      <div class="outline">
        <div class="outline-content" :style="!props.info.remarks && !props.info.value && { justifyContent: 'center' }">
          <div class="outline-title">
            {{ props.info.text }}
          </div>
          <p class="outline-subTitle" v-if="props.info.subTitle">——{{ props.info.subTitle }}</p>
          <div class="outline-cover" v-if="props.info.value" :style="!props.info.value && { display: 'none' }">
            <div class="cover">
              <img
                :class="!props.info.subTitle && !props.info.remarks && 'outlineMargin'"
                @click="ImgVisible = true"
                :src="urls + props.info.value + '?imageView2/3/format/webp'"
                alt=""
              />
            </div>
          </div>
          <TextMax
            v-if="props.domShow"
            :data="props.info.remarks"
            :title="props.info.text"
            :infoData="props.info"
            :class="!props.info.value && props.info.subTitle && 'remarksMargin'"
            :row="props.info.value ? 3 : !props.info.value && props.info.subTitle ? 8 : 10"
          ></TextMax>
        </div>
      </div>
    </div>
  </div>
</template> 

<script lang="ts">
export default defineComponent({
  name: 'free6Style3',
});
</script>

<script setup lang="ts">
import { publicUrls } from '@/utils/minxin';
import digitalShowroomInfo from '@/freeComponents/unitdigitalShowroom/style6.vue';
import textMode from '../../../textMode/textMode.vue';
import { urls } from '@/utils/request/upload';
import TextMax from '@/freeComponents/textMode/TextMax.vue';
import { defineComponent, ref } from 'vue';
import { useProjectStore } from '@/store';
const store = useProjectStore();

const ImgVisible = ref(false);

const props = defineProps({
  info: {
    type: Object,
  },
  domShow: {
    type: Boolean,
  },
});

// 跳转全景链接
const open = (url: any) => {
  if (url) {
    window.open(url, '_blank');
  }
};
</script>

<style scoped lang="less">
.outline-parent {
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
  margin-right: 140px;
  margin-left: 40px;
}
.Showroom-parent {
  position: absolute;
  top: 10px;
  right: 33px;
  z-index: 21;
}
.flex-box {
  width: 434px;
  height: 684px;
  display: flex;
  flex-direction: column;
  justify-content: start;
  position: relative;
  padding: 96px 0px 196px 0px;
  z-index: 20;
  overflow: hidden;
}

.outline-parent-bg {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}
.outline {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  z-index: 22;
  padding-right: 12px;
}
.outline-content {
  width: 320px;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.outline-title {
  width: 100%;
  color: #737d87;
  text-align: center;
  font-family: 'SourceHanSerifCN-Bold';
  font-size: 20px;
  line-height: 30px;
  margin-bottom: 10px;
}
.outline-subTitle {
  width: 100%;
  font-family: SourceHanSerifCN;
  color: #737d87;
  text-align: center;
  font-size: 16px;
  line-height: 28px;
  margin-bottom: 10px;
}
.outline-cover {
  width: 100%;
  max-height: 329px;
  flex: 1;
  margin-bottom: 10px;
  background: rgba(220, 217, 211, 0.31);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  .cover {
    width: 100%;
    height: 100%;
    overflow: hidden;
    &:hover img {
      transform: scale(1.2);
    }
    img {
      width: 100%;
      height: 100%;
      object-fit: contain;
      transition: all 0.3s ease;
    }
  }
}
.outlineMargin {
  margin-top: 10px;
  margin-bottom: 0 !important;
}
.remarksMargin {
  margin-top: 10px;
}

::v-deep .van-text-ellipsis {
  font-family: PingFang SC !important;
  font-size: 16px !important;
  color: #686763 !important;
  line-height: 32px !important;
}
::v-deep .van-text-ellipsis__action::before {
  color: #737d87 !important;
  font-weight: 800 !important;
}
::v-deep .t-popup__content {
  background: #56677b;
  padding: 2px 12px;
  font-family: 'Microsoft YaHei';
  font-size: 13px;
  line-height: 20px;
  color: #f1efea;
  box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, 0.25);
  margin-top: 6px !important;
}
::v-deep .t-popup__arrow::before {
  background: #56677b;
  border: none;
  box-shadow: none !important;
}
</style>